#include "../inc/sched.h"

#include <linux/cpu.h>
#include <linux/rbtree_augmented.h>
#include <linux/math.h>

static inline void update_curr_task(struct task_struct *p, s64 delta_exec)
{
}

static s64 update_curr_se(struct rq *rq, struct sched_entity *curr)
{
    u64 now = rq_clock_task(rq);
    s64 delta_exec;

    delta_exec = now - curr->exec_start;
    if (unlikely(delta_exec <= 0))
        return delta_exec;

    curr->exec_start = now;
    curr->sum_exec_runtime += delta_exec;

    // TODO

    return delta_exec;
}

s64 update_curr_common(struct rq *rq)
{
    struct task_struct *donor = rq->donor;
    s64 delta_exec;

    delta_exec = update_curr_se(rq, &donor->se);
    if (likely(delta_exec > 0))
        update_curr_task(donor, delta_exec);

    return delta_exec;
}
